/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hhf.worldzones.services.languageServices;

import hhf.flex.annotations.FlexDestination;
import hhf.worldzones.daos.LanguageDAO;
import hhf.worldzones.entities.Language;
import hhf.worldzones.exceptions.EntityUnknownException;
import hhf.worldzones.exceptions.LanguageUnknownException;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import javax.inject.Inject;
import org.slf4j.Logger;

/**
 *
 * @author François
 */
@Stateless
@LocalBean
@FlexDestination
public class LanguageServices {

	@Inject
	Logger logger;
	@EJB
	LanguageDAO languageDAO;
	
	public void remove(Language entity) {
		languageDAO.remove(entity);
	}

	public void persist(Language entity) {
		languageDAO.persist(entity);
	}

	public Language merge(Language entity) {
		return languageDAO.merge(entity);
	}

	public List<Language> findRange(int[] range) {
		return languageDAO.findRange(range);
	}

	public List<Language> findAll() {
		return languageDAO.findAll();
	}

	public Language find(Object id) throws LanguageUnknownException{
		try {
			return languageDAO.find(id);
		} catch (EntityUnknownException ex) {
			throw new LanguageUnknownException(ex);
		}
	}

	public int count() {
		return languageDAO.count();
	}
}
